/**
 * Created with JetBrains WebStorm.
 * User: Eric
 * Date: 09/03/13
 * Time: 17:56
 * To change this template use File | Settings | File Templates.
 */

var security = require('crypto');

exports.hashPassword = function(password){
        var sharsum = security.createHash("sha1");
        sharsum.update(password);
        return sharsum.digest('hex');
}

//methode generation du token
exports.getToken = function(){
    return require('crypto').randomBytes(20).toString('hex');
};
